package com.javaclimb.music.service.impl;

import com.javaclimb.music.dao.SingerMapper;
import com.javaclimb.music.domain.Singer;
import com.javaclimb.music.service.SingerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SingerServiceImpl implements SingerService {

    @Autowired
    private SingerMapper singerMapper;

    @Override
    public List<Singer> selectAll() {
        return singerMapper.selectAll();
    }

    @Override
    public Integer addSinger(Singer singer) {
        return singerMapper.addSinger(singer);
    }


    /**
     * 根据歌手名字模糊查询列表
     *
     * @param name
     */
    @Override
    public List<Singer> singerOfName(String name) {
        return singerMapper.singerOfName(name);
    }

    /**
     * 根据性别查询
     *
     * @param sex
     */
    @Override
    public List<Singer> singerOfSex(Integer sex) {
        return singerMapper.singerOfSex(sex);
    }

    @Override
    public Integer updateSinger(Singer singer) {
        return singerMapper.updateSinger(singer);
    }

    @Override
    public Integer deleteSinger(Integer id) {
        return singerMapper.deleteSinger(id);
    }


}
